import Vue from 'vue'
import Router from 'vue-router'
import AccountSearch from '../components/accountSearch.vue'
import MainPage from '../components/main_page.vue'
import categoryManage from '../components/categoryManage.vue'
import Login from '../components/login.vue'
import DataManage from '../components/dataManage.vue'
import Common from '../utils/Common.vue'


Vue.prototype.Common = Common
Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/admins/cookies',
      name: "login",
      component: Login,
    },

    {
      path: '/admins/mainPage',
      name: "mainPage",
      component: MainPage,
      redirect: '/admins/global',
      children: [
        {
          path: '/admins/users',
          component: AccountSearch,
          name: "accountSearch",

        },
        {
          path: '/admins/categories',
          component: categoryManage,
          name: "categoryManage",

        },
        {
          path: '/admins/global',
          component: DataManage,
          name: "dataManage",
        }

      ]


    },

  ]
})

export default router